#ifndef SYSTEMTRAYICON_H
#define SYSTEMTRAYICON_H

#include <QSystemTrayIcon>
class QMenu;
class QAction;
class ConfigEditor;

class SystemTrayIcon : public QSystemTrayIcon
{
    friend int main(int argc, char *argv[]);
public:
    SystemTrayIcon(QObject *parent = nullptr);
    ~SystemTrayIcon();

private:
    ConfigEditor* ce;

    QMenu *menu;

    QMenu *modeSubMenu;
    QAction *changeModeAllAction;
    QAction *changeModeNoneAction;
    QAction *changeModeCustomAction;

    QAction *searchAction;
    QAction *ocrTextAction;
    QAction *ocrTranslateAction;

    QAction *configAction;
    QAction *aboutAction;

    QMenu *helpSubMenu;
    QAction *guideAction;
    QAction *manualAction;
    QAction *homepageAction;
    QAction *donateAction;
    QAction *getCDKeyAction;
    QAction *checkUpdateAction;

    QAction *feedbackAction;

    QAction *quitAction;
    QIcon iconLive;
    QIcon iconGrey;

    void initUI();
    void connectSignals();
    void setModeText(QAction *modeAction, bool checked);

private slots:
    void onQuitAction();
    void onConfigAction();
    void onModeChanged();
    void onConfigEditorClosed();
};

#endif // SYSTEMTRAYICON_H
